% TEST_ID: LANG-EXPAND-0055
% CATEGORY: language/reflection
% 测试 who 函数

function test_who
    x = true;
    y = false;
    z = true(1,2);
    t = false(2,1);
    A = [1,2,3];
    global B;
    B = ones(100);
    global BX;
    BX = ones(100,2);
    global AB;
    AB = 'ab';

    v = who;

    assert(isequal(size(v), [8, 1]))
    v = who('global')
    assert(numel(v) == 3)
    v = who('A', 'B', 'x', 'y', 'm', 'n')
    assert(numel(v) == 4)
    v = who('global', '-regexp', '^B')
    assert(numel(v) == 2)

end
